[<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
##############################################################################
###+---------+################################################################
#+-| TRUNC() |------------------------------------+###########################
#| +---------+ Returns the whole part of argument |###########################
#+------------------------------------------------+###########################
##############################################################################
##############################################################################
#+--| Summary |--------------+################################################
#|     #INCLUDE math.hdr     |################################################
#+---------------------------+################################################
##############################################################################
##############################################################################
#+--| Syntax |----------------------------+###################################
#|     FUNCTION DBL trunc PROTOTYPE       |###################################
#|      PARAMETERS CONST DBL argument     |###################################
#+----------------------------------------+###################################
##############################################################################
##############################################################################
############+---| Description |----------------------------------+############
############| The trunc() function returns the whole part of     |############
############| argument.  For positive numbers, the next lowest   |############
############| integer is returned;for negative numbers, the next |############
############| positive integer is returned.                      |############
############+----------------------------------------------------+############
##############################################################################
##############################################################################
#########+--| Example 1 |-------------------------------------------+#########
#########| *    Use trunc() to round dollar amounts to the cent.    |#########
#########|                                                          |#########
#########| ? trunc(in_value * 100) / 100    && Rounded to the cent. |#########
#########+----------------------------------------------------------+#########
##############################################################################
##############################################################################
#########+--| Example 2 |-------------------------------------------+#########
#########|                                                          |#########
#########| ? trunc( 344.99 )                                        |#########
#########| ? trunc( 1 )                                             |#########
#########| ? trunc( 56.50 )                                         |#########
#########| ? trunc( 54.45 )                                         |#########
#########| ? trunc( 60.019 )                                        |#########
#########| ? trunc( 60.01 )                                         |#########
#########+----------------------------------------------------------+#########
##############################################################################

See Also: abs() round()
This page created by ng2html v1.05, the Norton guide to HTML conversion utility. Written by Dave Pearson